# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kalk
pkgver=24.02.2
pkgrel=0
pkgdesc="A powerful cross-platfrom calculator application"
arch="all !armhf" # Blocked by qt6-qtdeclarative
url="https://invent.kde.org/utilities/kalk"
license="GPL-3.0-or-later"
makedepends="
	bison
	extra-cmake-modules
	flex
	gmp-dev
	kconfig-dev
	kcoreaddons-dev
	ki18n-dev
	kirigami-dev
	kunitconversion-dev
	libqalculate-dev
	mpfr-dev
	qt6-qtbase-dev
	samurai
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/utilities/kalk.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kalk-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure -E "knumbertest|inputmanagertest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
045eb4ab38b700e0ee44f70e5df10341255d51cf0fd99fd8f4c55323e1672e6e6213c84bb26aa5085fbeab1c572adbb88de444b2585aa15f0d7657eac220d038  kalk-24.02.2.tar.xz
"
